home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / include / dxerr8.h < prev    next >
C/C++ Source or Header  |  2001-10-16  |  3KB  |  101 lines

  1. /*==========================================================================;
  2.  *
  3.  *
  4.  *  File:   dxerr8.h
  5.  *  Content:    DirectX Error Library Include File
  6.  *
  7.  ****************************************************************************/
  8.  
  9. #ifndef _DXERR8_H_
  10. #define _DXERR8_H_
  11.  
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif //__cplusplus
  15.  
  16. //
  17. //  DXGetErrorString8
  18. //  
  19. //  Desc:  Converts a DirectX HRESULT to a string 
  20. //
  21. //  Args:  HRESULT hr   Can be any error code from
  22. //                      D3D8 D3DX8 DDRAW DPLAY8 DMUSIC DSOUND DINPUT DSHOW
  23. //
  24. //  Return: Converted string 
  25. //
  26. const char*  WINAPI DXGetErrorString8A(HRESULT hr);
  27. const WCHAR* WINAPI DXGetErrorString8W(HRESULT hr);
  28.  
  29. #ifdef UNICODE
  30. #define DXGetErrorString8 DXGetErrorString8W
  31. #else
  32. #define DXGetErrorString8 DXGetErrorString8A
  33. #endif 
  34.  
  35.  
  36. //
  37. //  DXGetErrorDescription8
  38. //  
  39. //  Desc:  Returns a string description of a DirectX HRESULT
  40. //
  41. //  Args:  HRESULT hr   Can be any error code from
  42. //                      D3D8 D3DX8 DDRAW DPLAY8 DMUSIC DSOUND DINPUT DSHOW
  43. //
  44. //  Return: String description
  45. //
  46. const char*  WINAPI DXGetErrorDescription8A(HRESULT hr);
  47. const WCHAR* WINAPI DXGetErrorDescription8W(HRESULT hr);
  48.  
  49. #ifdef UNICODE
  50.     #define DXGetErrorDescription8 DXGetErrorDescription8W
  51. #else
  52.     #define DXGetErrorDescription8 DXGetErrorDescription8A
  53. #endif 
  54.  
  55.  
  56. //
  57. //  DXTrace
  58. //
  59. //  Desc:  Outputs a formatted error message to the debug stream
  60. //
  61. //  Args:  CHAR* strFile   The current file, typically passed in using the 
  62. //                         __FILE__ macro.
  63. //         DWORD dwLine    The current line number, typically passed in using the 
  64. //                         __LINE__ macro.
  65. //         HRESULT hr      An HRESULT that will be traced to the debug stream.
  66. //         CHAR* strMsg    A string that will be traced to the debug stream (may be NULL)
  67. //         BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info.
  68. //
  69. //  Return: The hr that was passed in.  
  70. //
  71. HRESULT WINAPI DXTraceA( char* strFile, DWORD dwLine, HRESULT hr, char* strMsg, BOOL bPopMsgBox );
  72. HRESULT WINAPI DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, BOOL bPopMsgBox );
  73.  
  74. #ifdef UNICODE
  75. #define DXTrace DXTraceW
  76. #else
  77. #define DXTrace DXTraceA
  78. #endif 
  79.  
  80.  
  81. //
  82. // Helper macros
  83. //
  84. #if defined(DEBUG) | defined(_DEBUG)
  85. #define DXTRACE_MSG(str)              DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE )
  86. #define DXTRACE_ERR(str,hr)           DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE )
  87. #define DXTRACE_ERR_NOMSGBOX(str,hr)  DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE )
  88. #else
  89. #define DXTRACE_MSG(str)              (0L)
  90. #define DXTRACE_ERR(str,hr)           (hr)
  91. #define DXTRACE_ERR_NOMSGBOX(str,hr)  (hr)
  92. #endif
  93.  
  94.  
  95. #ifdef __cplusplus
  96. }
  97. #endif //__cplusplus
  98.  
  99. #endif // _DXERR8_H_
  100.  
  101.